<script>

export default {
  name: 'BlogDetailComponents',
  props: ['blog']
}
</script>

<template>
  <div class="ql-container">
    <div class="title"><h2>{{blog.title}}</h2></div>
    <div class="tags">
      <el-tag v-for="tag in blog.blogTagList" :key="tag.tagId" effect="plain" type="success">{{tag.tag.name}}</el-tag>
    </div>
    <div class="info">
      <div class="author">
        <p>作者：{{blog.createUserinfo?.nickname}}</p>
      </div>
      <div class="category">
        <p>所属分类：<el-tag>{{blog.category?.name}}</el-tag></p>
      </div>
      <div class="time">
        <p v-if="blog.blogStatus === 1">发表时间：{{blog.applyTime}}</p>
        <p v-else>暂未发布</p>
      </div>
    </div>
    <div class="ql-editor" v-html="blog.content"></div>
  </div>
</template>

<style scoped lang="scss">
.ql-container{
  .title{
    h2{
      color: black;
      text-align: center;
    }
  }
  .tags{
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
  }
  .info{
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .ql-editor{
    color: black;
    border-top: 1px solid #ccc;
    margin-bottom: 10px;
  }
}
</style>
